import axiosRequest from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 驾驶舱api接口集合
 * @method  queryAlarmPropertyHistoryByWeek 查询本周和上周的漏水/温度报警统计数据
 * @method  queryAlarmRecordOneWeek 查询一周内机房报警记录
 */
export function useHomeApi() {
  return {
    queryAlarmPropertyHistoryByWeek: async (params: object) => {
      return await axiosRequest({
        url: '/api/mqtt/largeScreen/queryAlarmPropertyHistoryByWeek',
        method: 'POST',
        params,
      });
    },
    queryAlarmRecordOneWeek: async (params: object) => {
      return await axiosRequest({
        url: '/api/mqtt/largeScreen/queryAlarmRecordOneWeek',
        method: 'POST',
        params,
      });
    },
  }
}
